Skip to content

Decouple gamma scheduling from AGD via GammaScheduler#71

Open
sanjanag wants to merge 2 commits intolinkedin:masterfrom
sanjanag:gamma-scheduler
Open

Decouple gamma scheduling from AGD via GammaScheduler#71
sanjanag wants to merge 2 commits intolinkedin:masterfrom
sanjanag:gamma-scheduler

Conversation

@sanjanag
Copy link
Copy Markdown
Contributor

Summary

Gamma decay used to live inside AcceleratedGradientDescent, which made
adding new schedules require touching the optimizer and made it hard for
the optimizer to stay agnostic about objective regularization. This PR
moves the policy out:

  • New GammaScheduler owns the schedule (step and interval built in,
    trivially extensible) and drives the objective via set_gamma().
  • AGD.maximize() gets a step_callback hook; the scheduler plugs in there.
  • Objectives now own their gamma. MIPLIB2017ObjectiveFunction accepts
    gamma in __init__; both matching objectives gain set_gamma().
  • BaseObjective.set_gamma is a no-op default so objectives without a
    regularization parameter keep working unchanged.
  • run_solver constructs a GammaScheduler automatically when
    solver_args.gamma_decay_type is set.
  • Small refactor: pull calc_grad into utils/objective_utils so the
    matching variants share it without an objectives→objectives import.

API change

AcceleratedGradientDescent.__init__ no longer takes gamma,
gamma_decay_type, or gamma_decay_params. Pass gamma to the objective
constructor instead, and use GammaScheduler + step_callback for decay.
MIPLIB2017ObjectiveFunction.calculate no longer takes gamma per call;
update gamma via set_gamma().

Test plan

  • New tests/test_gamma_scheduler.py (12 cases): step + interval
    schedules, AGD integration via step_callback, parameter
    validation, no-decay case, gamma-increase warning
  • Existing tests updated to the new API; full suite green
    (pytest tests/ --ignore=tests/distributed: 58 passed, 2 skipped)

sanjanag and others added 2 commits April 27, 2026 14:48
Move gamma decay out of AcceleratedGradientDescent into a standalone
GammaScheduler that drives the objective via set_gamma() and is wired
into the optimizer through a new step_callback hook on maximize().
The optimizer no longer owns gamma; objectives store and update their
own. Add an 'interval' schedule alongside the existing 'step' decay.

Extract the small calc_grad helper into utils/objective_utils so it can
be shared across matching variants without an objectives -> objectives
import.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant